import 'reflect-metadata'

function Inject(target: any, methodName: string, paramIndex: number) {
  console.log("Inject")
  let types = Reflect.getMetadata("design:paramtypes", target, methodName);
  let injectInstance = new types[paramIndex]()
  target[methodName].__DECORATE_DATA = {
    params: [
      {
        type: 'paramtypes',
        decoratorType: 'inject',
        injectParamValue: true,
        paramIndex: paramIndex,
        paramMetaData: types[paramIndex],
        paramValue: injectInstance
      }
    ]
  }
  // var s = types.map((a: any) => a.name).join();
  // console.log(`${methodName} param types: ${s}`);
  // target[methodName].call(window, new types[0])
}


export default Inject